package com.zmc.admin.infrastructure.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zmc.admin.infrastructure.entity.SysRoleEntity;
import com.zmc.admin.infrastructure.entity.SysUserRoleEntity;
import com.zmc.admin.infrastructure.bean.query.SysRoleQuery;
import com.zmc.common.utils.PageUtils;

import java.util.List;

/**
 * 角色信息表
 *
 * @author zmc
 * @email 
 * @date 2024-10-09 17:27:49
 */
public interface SysRoleService extends IService<SysRoleEntity> {

    List<SysRoleEntity> selectRolePermissionByUserId(Long userId);

    List<SysRoleEntity> selectRolesByUserName(String userName);

    PageUtils pageRoleList(SysRoleQuery query);

    List<SysRoleEntity> selectRoleList(SysRoleQuery query);

    boolean checkRoleNameUnique(SysRoleEntity role);

    boolean checkRoleKeyUnique(SysRoleEntity role);

    void authDataScope(SysRoleEntity role);

    void deleteAuthUser(SysUserRoleEntity userRole);

    void deleteAuthUsers(Long roleId, Long[] userIds);

    void insertAuthUsers(Long roleId, Long[] userIds);

    List<SysRoleEntity> selectRolesByUserId(Long userId);


    public List<Long> selectRoleListByUserId(Long userId);

    SysRoleEntity queryByRoleKey(String roleKey);
}

